﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;
using System.Data;

namespace BLL
{
    public class B_Dangky
    {
        public M_Dangky GetByPK_DangkyID(int DangkyID)
        {
            return (new D_Dangky()).GetbyPK_DangkyID(DangkyID);
        }

        public DataTable GetAll()
        {
            return (new D_Dangky()).GetAll();
        }

        public DataTable GetByFK_KhachID(int KhachID)
        {
            return (new D_Dangky()).GetByFK_KhachID(KhachID);
        }
        public DataTable GetByFK_PhongID(int PhongID)
        {
            return (new D_Dangky()).GetByFK_PhongID(PhongID);
        }

        public void Insert(M_Dangky M_Dangky)
        {
            (new D_Dangky()).Insert(M_Dangky);
        }

        public void Update(M_Dangky M_Dangky)
        {
            (new D_Dangky()).Update(M_Dangky);
        }

        public void Delete(int DangkyID)
        {
            if (DangkyID <= 0)
                throw new Exception("Không hợp lệ! Vui lòng thử lại sau!");

            new D_Dangky().Delete(DangkyID);
        }
    }
}
